package com.qiyun.amqp.service;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Created by double.
 * @Date: 2018/8/21
 * @remarks:
 */
@Component

public class HelloReceiver {
/*
    @RabbitHandler
    @RabbitListener(queues = "topic.message")
    public void process(String hello) {
        System.out.println("Receiver  1 : " + hello);
    }

    @RabbitHandler
    @RabbitListener(queues = "topic.messages")
    public void process1(String hello) {
        System.out.println("Receiver  2 : " + hello);
    }

*/
    @RabbitHandler
    @RabbitListener(queues = "repeatTradeQueue")
    public void process2(String msg) {
        System.out.println("repeatTradeQueue 接收时间:"+ LocalDateTime.now().toString()+" 接收内容:"+msg);
    }

}